/**
 * 定义扑克牌花色、显示牌型、值以及扑克牌数据结构
 */

export namespace CARD {

  // 定义扑克牌值
  export const enum VALUE {
    THREE = 3,
    FOUR = 4,
    FIVE = 5,
    SIX = 6,
    SEVEN = 7,
    EIGHT = 8,
    NINE = 9,
    TEN = 10,
    JACK = 11,
    QUEEN = 12,
    KING = 13,
    ACE = 14,
    TWO = 15,
    BLACK_JOKER = 16,
    RED_JOKER = 17
  }

  // 定义扑克牌符号
  export const enum SYMBOL {
    THREE = "3",
    FOUR = "4",
    FIVE = "5",
    SIX = "6",
    SEVEN = "7",
    EIGHT = "8",
    NINE = "9",
    TEN = "10",
    JACK = "J",
    QUEEN = "Q",
    KING = "K",
    ACE = "A",
    TWO = "2",
    BLACK_JOKER = "BlackJoker",
    RED_JOKER = "RedJoker"
  }

  // 定义扑克牌花色
  export const enum SUIT {
    SPADE = "Spade",      // 黑桃 ♠
    HEART = "Heart",      // 红桃 ♥
    CLUB = "Club",        // 梅花 ♣
    DIAMOND = "Diamond",  // 方块 ♦
    JOKER = "Joker"       // 大小王无花色
  }
}

// 定义扑克牌
export class PokerCard {
  public value: number;  // 值, 用于排序比较
  public suit: string;   // 花色
  public name: string;   // 显示的字符

  constructor(value: number, suit: string, name: string) {
    this.value = value;
    this.suit = suit;
    this.name = name;
  }

  // 获取扑克牌的值
  public GetValue(): number {
    return this.value;
  }

  // 获取扑克牌的花色
  public GetSuit(): string {
    return this.suit;
  }

  // 获取扑克牌的名字
  public GetCardName(): string {
    return this.name;
  }
}
